package dawnland03.model.item;

import dawnland03.model.entity.Entity;

/**
 * User: Petru Obreja (obrejap@yahoo.com)
 * Date: Jan 23, 2010
 * Time: 10:59:18 PM
 */
public class Item {
    private final Integer id;
    private final ItemType itemType;
    private final Integer ownerId;

    public Item(Integer id, ItemType itemType, Integer ownerId) {
        this.id = id;
        this.itemType = itemType;
        this.ownerId = ownerId;
    }

    public Integer getId() {
        return id;
    }

    public ItemType getItemType() {
        return itemType;
    }

    public Integer getOwnerId() {
        return ownerId;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Item item = (Item) o;

        if (!id.equals(item.id)) return false;

        return true;
    }

    public int hashCode() {
        return id.hashCode();
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("I[").append(id).append(",").append(itemType).append(",").append(ownerId).append("]");
        return stringBuilder.toString();
    }
}
